Skip to content

Extremum: new extremum plugin family for coarse majorant and minorant superstructures. - #1960

Open
frettini wants to merge 1 commit into
mitsuba-renderer:masterfrom
frettini:extremum
Open

Extremum: new extremum plugin family for coarse majorant and minorant superstructures.#1960
frettini wants to merge 1 commit into
mitsuba-renderer:masterfrom
frettini:extremum

Conversation

@frettini

@frettini frettini commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

This PR proposes an implementation of majorant supergrids, extending it to also contain minorant values and to extend it beyond grids. We named those Extremum structures.

I did my best to extract the relevant part of work on Extremum structures from other changes on our fork. I open this PR with the intention of advancing the discussion on finding a suitable interface for Extremum structures/majorant supergrids, rather than to merge this work directly, as I believe it could be dramatically improved, especially for llvm and cuda variants.

Our requirements:

  • Local majorant and minorant values that can help us speed up delta and ratio tracking for highly heterogeneous media e.g. atmosphere and clouds.
  • Different super structures for different volume types: we use grid volumes as much as volumes defined over spherical coordinates. Grid based super structures (regular grid, octrees, ...) can struggle to tightly fit extremum values over such volumes.
  • A framework that is general enough to apply to any integrator that needs it (volpath, volpathmis).

Main design points:

The new Extremum plugin family:

  • Decoupled from Volume and Medium plugins, but expected to be owned by a Medium.
  • Holds a coarse structure of local majorant and minorant values, hence the name extremum. This opens the possibility to implement residual ratio tracking and similar techniques.
  • build function builds the structure from a volume. Expected to be called from the owning Medium. A new extremum function has been added to Volume to query the local extremum in a given bbox. The volume also exposes a parametrization function that contains information describing the volume's frame and coordinate. Our fork extends this further to accommodate Cartesian and spherical coordinates.
  • update_extremum rebuilds, and updates the bbox, and scale. The bbox corresponds to the Medium bbox, and indicates the domain over which the extremum must be valid. The scale permits an easy way to update the densities without rebuild the Extremum structure.
  • traverse_extremum traverses the structure along a ray. Accepts a callback function that is called at every encountered extremum segment. This structure allows to traverse the whole structure in one virtual call instead of having repeated virtual calls in the hot loop. The callback is expected to be passed from the integrator, so that we don't make assumptions on the type of tracking performed (delta, ratio, residual ratio), and are compatible with all integrator types. The callback signature and payload are defined in tracking.h.

Two Extremum plugins were added: extremum_global which reverts to the previous approach and extremum_grid which creates an extremum supergrid.

I tried to keep elements as decoupled as possible and not make assumptions on the representation of volumes or extremum structures. This can cause some inefficiencies, and the way forward might be to find some way to further constrain the problem e.g. assume DDA-like traversal.

Benchmark

Here is a small benchmark over a rendered scene that contains the volume in ./tutorials/scenes/volume.vol. It reports the results using a global extremum and grid extremum with increasing resolution, over scalar, llvm, and cuda variants. We can see these changes improve scalar variants much more than other variants.

volume_surface_time_vs_spp

Testing

Ran and passed all tests except two render tests that seem to report wrong max value in the srgb spectrum. Added tests for the new global and grid plugins.

Checklist

  • My code follows the style guidelines of this project
  • My changes generate no new warnings
  • My code also compiles for cuda_* and llvm_* variants. If you can't test this, please leave below
  • I have commented my code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I cleaned the commit history and removed any "Merge" commits
  • I give permission that the Mitsuba 3 project may redistribute my contributions under the terms of its license

Coarse structures of majorant and minorant values over volumetric data. At runtime can be traversed to perform tracking algorithms (e.g. delta tracking or ratio tracking) using the `traverse_extremum` function. Built from sigma_t volumes in media, but intentionally decoupled to allow for different volumetric representations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant